"""exercise URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path, re_path
from exercise import views

app_name = 'exercise'
urlpatterns = [
    # 手动添加一个题目
    re_path(r'^add/$', views.AddExercise.as_view(), name='add'),
    # 批量导入题目
    re_path(r'^upload/$', views.UploadExercise.as_view(), name='upload'),
    # 查看题库
    re_path(r'^show_exercise/$', views.ShowExercise.as_view(), name='show_exercise'),
    # 删除题目
    re_path(r'^delete/$', views.delete_exercise, name='delete'),
    # 随机刷题
    re_path(r'^do_exercise/$', views.DoExercise.as_view(), name='do_exercise'),
    # 收藏题目
    re_path(r'^collect/$', views.collect_exercise, name='collect'),
    # 显示收藏题目
    re_path(r'^show_collection/$', views.ShowCollection.as_view(), name='show_collection'),
    # 取消收藏
    re_path(r'^cancel_collection/$', views.cancel_collection, name='cancel_collection'),
    # 显示题目详情
    re_path(r'^detail/$', views.detail_exercise, name='detail'),

]
